﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenerateAdminPage.Classes.Views
{
    #region USING
    using GenerateAdminPage.Classes.Helpers;
    using GenerateAdminPage.Classes.DBStructure;
    #endregion

    public class ViewSelectManyForOne : AbstractViews
    {
        public override string GenerateFields()
        {
            StringBuilder Result = new StringBuilder();

            Result.AppendLine(TAB2 + "private DevComponents.DotNetBar.PanelEx panelEx1;");
            Result.AppendLine(TAB2 + "private DevComponents.DotNetBar.Controls.GroupPanel grpListData;");
            Result.AppendLine(TAB2 + "private DevComponents.DotNetBar.LabelX lblManageName;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.Panel panel2;");
            Result.AppendLine(TAB2 + "private DevComponents.DotNetBar.Controls.DataGridViewX dtgvData;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.Panel panel1;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.BindingNavigator binFunctions;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.ToolStripButton btnThem;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.ToolStripButton btnXoa;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.ToolStripButton btnCapNhat;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;");
            Result.AppendLine(TAB2 + "private System.Windows.Forms.ToolStripButton btnThoat;");

            return Result.ToString();
        }

        public override string GenerateInitializeComponent()
        {
            StringBuilder Result = new StringBuilder();

            Result.AppendLine(TAB2 + "private void InitializeComponent()");
            Result.AppendLine(TAB2 + "{");
            Result.AppendLine(TAB3 + "this.components = new System.ComponentModel.Container();");
            Result.AppendLine(TAB3 + "System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();");
            Result.AppendLine(TAB3 + "System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmQuanLy" + TblOne.Name + "));");
            Result.AppendLine(TAB3 + "this.panelEx1 = new DevComponents.DotNetBar.PanelEx();");
            Result.AppendLine(TAB3 + "this.lblManageName = new DevComponents.DotNetBar.LabelX();");

            Result.AppendLine(TAB3 + "this.panel2 = new System.Windows.Forms.Panel();");
            Result.AppendLine(TAB3 + "this.dtgvData = new DevComponents.DotNetBar.Controls.DataGridViewX();");
            Result.AppendLine(TAB3 + "this.panel1 = new System.Windows.Forms.Panel();");
            Result.AppendLine(TAB3 + "this.binFunctions = new System.Windows.Forms.BindingNavigator(this.components);");
            Result.AppendLine(TAB3 + "this.btnThem = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.btnXoa = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.btnCapNhat = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();");
            Result.AppendLine(TAB3 + "this.btnThoat = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.grpListData = new DevComponents.DotNetBar.Controls.GroupPanel();");
            Result.AppendLine(TAB3 + "this.panelEx1.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.panel2.SuspendLayout();");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.dtgvData)).BeginInit();");
            Result.AppendLine(TAB3 + "this.panel1.SuspendLayout();");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.binFunctions)).BeginInit();");
            Result.AppendLine(TAB3 + "this.binFunctions.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.grpListData.SuspendLayout();");

            Result.AppendLine(TAB3 + "this.SuspendLayout();" + END);
            Result.AppendLine(TAB3 + "this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.panelEx1.Controls.Add(this.lblManageName);");
            Result.AppendLine(TAB3 + "this.panelEx1.Dock = System.Windows.Forms.DockStyle.Top;");
            Result.AppendLine(TAB3 + "this.panelEx1.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.panelEx1.Name = \"panelEx1\";");
            Result.AppendLine(TAB3 + "this.panelEx1.Size = new System.Drawing.Size(492, 52);");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.Peru;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.White;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.GradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.panelEx1.TabIndex = 23;");
            Result.AppendLine(TAB3 + "this.lblManageName.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.lblManageName.Font = new System.Drawing.Font(\"Times New Roman\", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
            Result.AppendLine(TAB3 + "this.lblManageName.ForeColor = System.Drawing.Color.Blue;");
            Result.AppendLine(TAB3 + "this.lblManageName.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.lblManageName.Name = \"lblManageName\";");
            Result.AppendLine(TAB3 + "this.lblManageName.Size = new System.Drawing.Size(492, 52);");
            Result.AppendLine(TAB3 + "this.lblManageName.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.lblManageName.Text = \"" + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.lblManageName.TextAlignment = System.Drawing.StringAlignment.Center;" + END);

            Result.AppendLine(TAB3 + "this.panel2.Controls.Add(this.dtgvData);");
            Result.AppendLine(TAB3 + "this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.panel2.Location = new System.Drawing.Point(0, 46);");
            Result.AppendLine(TAB3 + "this.panel2.Name = \"panel2\";");
            Result.AppendLine(TAB3 + "this.panel2.Size = new System.Drawing.Size(486, 295);");
            Result.AppendLine(TAB3 + "this.panel2.TabIndex = 2;" + END);
            Result.AppendLine(TAB3 + "this.dtgvData.AllowUserToAddRows = false;");
            Result.AppendLine(TAB3 + "this.dtgvData.BackgroundColor = System.Drawing.Color.White;");
            Result.AppendLine(TAB3 + "this.dtgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;");
            Result.AppendLine(TAB3 + "this.dtgvData.DefaultCellStyle = dataGridViewCellStyle1;");
            Result.AppendLine(TAB3 + "this.dtgvData.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.dtgvData.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));");
            Result.AppendLine(TAB3 + "this.dtgvData.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.dtgvData.Name = \"dtgvData\";");
            Result.AppendLine(TAB3 + "this.dtgvData.ReadOnly = true;");
            Result.AppendLine(TAB3 + "this.dtgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;");
            Result.AppendLine(TAB3 + "this.dtgvData.Size = new System.Drawing.Size(486, 295);");
            Result.AppendLine(TAB3 + "this.dtgvData.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.dtgvData.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dtgvData_CellDoubleClick);" + END);
            Result.AppendLine(TAB3 + "this.panel1.BackColor = System.Drawing.Color.Transparent;");
            Result.AppendLine(TAB3 + "this.panel1.Controls.Add(this.binFunctions);");
            Result.AppendLine(TAB3 + "this.panel1.Dock = System.Windows.Forms.DockStyle.Top;");
            Result.AppendLine(TAB3 + "this.panel1.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.panel1.Name = \"panel1\";");
            Result.AppendLine(TAB3 + "this.panel1.Size = new System.Drawing.Size(486, 46);");
            Result.AppendLine(TAB3 + "this.panel1.TabIndex = 1;" + END);
            Result.AppendLine(TAB3 + "this.binFunctions.AddNewItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.BackColor = System.Drawing.Color.Transparent;");
            Result.AppendLine(TAB3 + "this.binFunctions.CountItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.DeleteItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.binFunctions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {");

            Result.AppendLine(TAB3 + "this.btnThem,");
            Result.AppendLine(TAB3 + "this.btnXoa,");
            Result.AppendLine(TAB3 + "this.btnCapNhat,");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5,");
            Result.AppendLine(TAB3 + "this.btnThoat});");
            Result.AppendLine(TAB3 + "this.binFunctions.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveFirstItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveLastItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveNextItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MovePreviousItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.Name = \"binFunctions\";");
            Result.AppendLine(TAB3 + "this.binFunctions.PositionItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;");
            Result.AppendLine(TAB3 + "this.binFunctions.Size = new System.Drawing.Size(486, 46);");
            Result.AppendLine(TAB3 + "this.binFunctions.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.binFunctions.Text = \"bindingNavigator1\";" + END);

            Result.AppendLine(TAB3 + "this.btnThem.Image = ((System.Drawing.Image)(resources.GetObject(\"btnThem.Image\")));");
            Result.AppendLine(TAB3 + "this.btnThem.Name = \"btnThem\";");
            Result.AppendLine(TAB3 + "this.btnThem.RightToLeftAutoMirrorImage = true;");
            Result.AppendLine(TAB3 + "this.btnThem.Size = new System.Drawing.Size(42, 43);");
            Result.AppendLine(TAB3 + "this.btnThem.Text = \"Thêm\";");
            Result.AppendLine(TAB3 + "this.btnThem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnThem.Click += new System.EventHandler(this.btnThem_Click);" + END);
            Result.AppendLine(TAB3 + "this.btnXoa.Image = ((System.Drawing.Image)(resources.GetObject(\"btnXoa.Image\")));");
            Result.AppendLine(TAB3 + "this.btnXoa.Name = \"btnXoa\";");
            Result.AppendLine(TAB3 + "this.btnXoa.RightToLeftAutoMirrorImage = true;");
            Result.AppendLine(TAB3 + "this.btnXoa.Size = new System.Drawing.Size(31, 43);");
            Result.AppendLine(TAB3 + "this.btnXoa.Text = \"Xóa\";");
            Result.AppendLine(TAB3 + "this.btnXoa.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnXoa.Click += new System.EventHandler(this.btnXoa_Click);" + END);
            Result.AppendLine(TAB3 + "this.btnCapNhat.Image = ((System.Drawing.Image)(resources.GetObject(\"btnCapNhat.Image\")));");
            Result.AppendLine(TAB3 + "this.btnCapNhat.ImageTransparentColor = System.Drawing.Color.Magenta;");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Name = \"btnCapNhat\";");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Size = new System.Drawing.Size(59, 43);");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Text = \"Cập nhật\";");
            Result.AppendLine(TAB3 + "this.btnCapNhat.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Click += new System.EventHandler(this.btnCapNhat_Click);" + END);
            Result.AppendLine(TAB3 + "this.toolStripSeparator5.Name = \"toolStripSeparator5\";");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5.Size = new System.Drawing.Size(6, 46);" + END);
            Result.AppendLine(TAB3 + "this.btnThoat.Image = ((System.Drawing.Image)(resources.GetObject(\"btnThoat.Image\")));");
            Result.AppendLine(TAB3 + "this.btnThoat.ImageTransparentColor = System.Drawing.Color.Magenta;");
            Result.AppendLine(TAB3 + "this.btnThoat.Name = \"btnThoat\";");
            Result.AppendLine(TAB3 + "this.btnThoat.Size = new System.Drawing.Size(42, 43);");
            Result.AppendLine(TAB3 + "this.btnThoat.Text = \"Thoát\";");
            Result.AppendLine(TAB3 + "this.btnThoat.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnThoat.Click += new System.EventHandler(this.btnThoat_Click);" + END);
            Result.AppendLine(TAB3 + "this.grpListData.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.grpListData.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;");
            Result.AppendLine(TAB3 + "this.grpListData.Controls.Add(this.panel2);");
            Result.AppendLine(TAB3 + "this.grpListData.Controls.Add(this.panel1);");
            Result.AppendLine(TAB3 + "this.grpListData.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.grpListData.Location = new System.Drawing.Point(0, 166);");
            Result.AppendLine(TAB3 + "this.grpListData.Name = \"grpListData\";");
            Result.AppendLine(TAB3 + "this.grpListData.Size = new System.Drawing.Size(492, 362);" + END);
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColorGradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderBottomWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderLeftWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderRightWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderTopWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.CornerDiameter = 4;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;");
            Result.AppendLine(TAB3 + "this.grpListData.TabIndex = 25;");
            Result.AppendLine(TAB3 + "this.grpListData.Text = \"Danh sách " + TblOne.Name + "\";" + END);
            Result.AppendLine(TAB3 + "this.ClientSize = new System.Drawing.Size(492, 528);");
            Result.AppendLine(TAB3 + "this.Controls.Add(this.grpListData);");
            Result.AppendLine(TAB3 + "this.Controls.Add(this.panelEx1);");
            Result.AppendLine(TAB3 + "this.DoubleBuffered = true;");
            Result.AppendLine(TAB3 + "this.MaximizeBox = false;");
            Result.AppendLine(TAB3 + "this.MinimizeBox = false;");
            Result.AppendLine(TAB3 + "this.Name = \"FrmQuanLy" + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;");
            Result.AppendLine(TAB3 + "this.Text = \"Quản lý " + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.Load += new System.EventHandler(this.FrmQuanLy" + TblOne.Name + "_Load);");
            Result.AppendLine(TAB3 + "this.panelEx1.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.panel2.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.dtgvData)).EndInit();");
            Result.AppendLine(TAB3 + "this.panel1.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.panel1.PerformLayout();");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.binFunctions)).EndInit();");
            Result.AppendLine(TAB3 + "this.binFunctions.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.binFunctions.PerformLayout();");
            Result.AppendLine(TAB3 + "this.grpListData.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.ResumeLayout(false);");

            Result.AppendLine(TAB2 + "}");

            return Result.ToString();
        }
    }
}
